<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>众筹管理后台</title>
		<link rel="stylesheet" href="admin/css/bootstrap.min.css" />
		<link rel="stylesheet" href="admin/css/dashboard.css" />
	</head>
	<body>
		<!-- 用户资金详情模态框 -->
		<div class="modal fade" id="usersDetailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		        <div class="modal-dialog">
		            <div class="modal-content">
		                <div class="modal-header">
		                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
		                        &times;
		                    </button>
		                    <h4 class="modal-title" id="myModalLabel">
		                        用户资金
		                    </h4>
		                </div>
		                <div class="modal-body">
		                    <form class="form-horizontal">
		                        <div class="form-group">
		                            <label for="firstname" class="col-sm-2 control-label">用户编号</label>
		                            <div class="col-sm-10">
		                                <input id="fdUsId" type="text" class="form-control" readonly="readonly">
		                            </div>
		                        </div>
								<div class="form-group">
		                            <label for="firstname" class="col-sm-2 control-label">账户余额</label>
		                            <div class="col-sm-10">
		                                <input id="usMoney" type="text" class="form-control" readonly="readonly">
		                            </div>
		                        </div>
		                        <div class="form-group">
		                            <label for="firstname" class="col-sm-2 control-label">投资总额</label>
		                            <div class="col-sm-10">
		                                <input id="totalMoney" type="text" class="form-control" readonly="readonly">
		                            </div>
		                        </div>
		                        
		                    </form>
		                </div>
		                <div class="modal-footer">
		                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
		                    </button>
		                    
		                </div>
		            </div><!-- /.modal-content -->
		        </div><!-- /.modal -->
		    </div>
			
			<!-- 修改新闻模态框 -->
			<div class="modal fade" id="updateNewsModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			        <div class="modal-dialog">
			            <div class="modal-content">
			                <div class="modal-header">
			                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
			                        &times;
			                    </button>
			                    <h4 class="modal-title" id="myModalLabel">
			                        修改新闻
			                    </h4>
			                </div>
			                <div class="modal-body">
			                    <form class="form-horizontal">
			                        <div class="form-group">
			                            <label for="firstname" class="col-sm-2 control-label">新闻编号</label>
			                            <div class="col-sm-10">
			                                <input id="questionotherid" type="text" class="form-control" readonly="readonly">
			                            </div>
			                        </div>
									<div class="form-group">
			                            <label for="firstname" class="col-sm-2 control-label">新闻标题</label>
			                            <div class="col-sm-10">
			                                <input id="questionothername" type="text" class="form-control" >
			                            </div>
			                        </div>
			                        <div class="form-group">
			                            <label for="firstname" class="col-sm-2 control-label">新闻内容</label>
			                            <div class="col-sm-10">
			                                <textarea id="questionanswer" class="form-control"></textarea>
			                            </div>
			                        </div>
			                        
			                    </form>
			                </div>
			                <div class="modal-footer">
			                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
			                    </button>
			                    <button type="button" id="updateOneNews" class="btn btn-primary">
			                                            提交更改
			                                        </button>
			                </div>
			            </div><!-- /.modal-content -->
			        </div><!-- /.modal -->
			    </div>
		
		<div id="getPsID" disabled="none">${psId}
		</div>
		<nav class="navbar navbar-inverse navbar-fixed-top">
			<div class="container-fluid">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"
					 aria-controls="navbar">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="#">众筹管理平台</a>
				</div>
				<div id="navbar" class="navbar-collapse collapse">
					<ul class="nav navbar-nav navbar-right">
						<li><a href="index.html">首页</a></li>
						<li><a href="#">欢迎, 张三</a></li>
						<li><a href="#" title="修改个人资料和密码的页面">设置</a></li>
						<li><a href="#" title="退出登录">退出</a></li>
					</ul>
				</div>
			</div>
		</nav>
		<div class="container-fluid">
			<div class="row">
				<div class="col-sm-3 col-md-2 sidebar">
					<ul class="nav nav-sidebar">
						<li class="active"><a href="toBackstageIndex">首页</a></li>
					</ul>
					<ul class="nav nav-sidebar">
						<li><a href="toBackProducts">所有项目</a></li>
						<li><a href="toBackProducts">项目审核</a></li>
						<!-- <li><a href="toBackProducts">项目跟踪</a></li> -->
						<li><a href="toBackProducts">项目评论</a></li>
						<li><a href="toBackProducts">项目分类</a></li>
						<li><a href="toBackProducts">项目推荐</a></li>
					</ul>
					<ul id="manUsers" class="nav nav-sidebar">
						<li class="active"><a href="#regisUsers" data-toggle="tab">用户管理</a></li>
						<li><a href="#UsersMoney" data-toggle="tab">用户资金</a></li>
						<li><a href="#UsersAutonym" data-toggle="tab">实名审核</a></li>
						<li><a href="#getNews" data-toggle="tab">新闻管理</a></li>
						<li><a href="#addNews" data-toggle="tab">添加新闻</a></li>
					</ul>
					<ul class="nav nav-sidebar">
						
						<li><a href="">问题管理</a></li>
						<li><a href="${pageContext.request.contextPath}/back/user/list.action">管理用户</a></li>
						<li><a href="">管理日志</a></li>
					</ul>
				</div>

				<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
					<div id="manUsers1" class="tab-content">
						<div id="regisUsers" class="tab-pane active">
							<h1 class="page-header">用户管理</h1>
							<div class="panel panel-default">
								<div class="panel-heading">
									<div class="panel-title">
										所有用户列表
									</div>
								</div>
								<div class="panel-body">
							
									<div class="table-responsive ">
										<table class="table table-striped table-bordered">
											<thead>
												<tr>
													<th>序号</th>
													<th>邮箱</th>
													<th>昵称</th>
													<th>身份证号</th>
													<th>手机号</th>
													<th>地址</th>
													<th>性别</th>
												</tr>
											</thead>
											<tbody id="userslist">
												
											</tbody>
										</table>
									</div>
							
									<nav aria-label="Page navigation" class="text-right">
										<ul class="pagination" id="showPage">
							
										</ul>
									</nav>
								</div>
							</div>
						</div>
						<div id="UsersMoney" class="tab-pane">
							<h1 class="page-header">用户资金</h1>
							<div class="table-responsive ">
								<table class="table table-striped table-bordered">
									<thead>
										<tr>
											<th>序号</th>
											<th>昵称</th>
											<th>用户资金</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody id="usersAccount">
										
									</tbody>
								</table>
							</div>
							
							
							<nav aria-label="Page navigation" class="text-right">
								<ul class="pagination" id="showPage1">
														
								</ul>
							</nav>
							
						</div>
						<div id="UsersAutonym" class="tab-pane">
							<h1 class="page-header">实名审核未激活的用户</h1>
							<div class="table-responsive ">
								<table class="table table-striped table-bordered">
									<thead>
										<tr>
											<th>序号</th>
											<th>昵称</th>
											<th>身份证号</th>
											<th>手机号</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody id="updateUserRole">
										
									</tbody>
								</table>
							</div>
							
							<nav aria-label="Page navigation" class="text-right">
								<ul class="pagination" id="showPage2">
														
								</ul>
							</nav>
							
						</div>
						<div id="getNews" class="tab-pane">
							<h1 class="page-header">新闻管理</h1>
								<div class="table-responsive ">
									<table class="table table-striped table-bordered">
										<thead>
											<tr>
												<th>序号</th>
												<th>新闻标题</th>
												<th>新闻内容</th>
												<th>发布时间</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody id="news">
											
										</tbody>
									</table>
								</div>
								
								<nav aria-label="Page navigation" class="text-right">
									<ul class="pagination" id="showPage3">
															
									</ul>
								</nav>
								
							</div>
							
						<div id="addNews" class="tab-pane">
								<h1 class="page-header">添加新闻</h1>
									<div class="modal-dialog">
									    <div class="modal-content">
									        <div class="modal-header">
									        </div>
									        <div class="modal-body" id="formclear">
									            <form class="form-horizontal">
													<div class="form-group">
									                    <label for="firstname" class="col-sm-2 control-label">新闻标题</label>
									                    <div class="col-sm-10">
									                        <input id="questionothername1" type="text" class="form-control" >
									                    </div>
									                </div>
									                <div class="form-group">
									                    <label for="firstname" class="col-sm-2 control-label">新闻内容</label>
									                    <div class="col-sm-10">
									                        <textarea id="questionanswer1" class="form-control"></textarea>
									                    </div>
									                </div>
									                
									            </form>
									        </div>
									        <div class="modal-footer">
									           
									            <button type="button" id="addOneNews" class="btn btn-primary">
									                                    提交
									                                </button>
									        </div>
									    </div><!-- /.modal-content -->
									</div>
								
									
						</div>
						
					</div>
				</div>
			</div>
		</div>

		<script type="text/javascript" src="${pageContext.request.contextPath}/admin/js/jquery1.12.4.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/admin/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/admin/js/countUp.js"></script>
		<script type="text/javascript">
			$(function(){
				var psId=$("#getPsID").html()
				//alert(psId)
				$('a[href="#regisUsers"]').click(function(){
					$("#manUsers>li").removeClass("active");
					$("#manUsers1>div").removeClass("active");
					$('a[href="#regisUsers"]').parent().addClass("active");
					$("#regisUsers").addClass("active");
				})
				$('a[href="#UsersMoney"]').click(function(){
					$("#manUsers>li").removeClass("active");
					$("#manUsers1>div").removeClass("active");
					$('a[href="#UsersMoney"]').parent().addClass("active");
					$("#UsersMoney").addClass("active");
				})
				$('a[href="#UsersAutonym"]').click(function(){
					$("#manUsers>li").removeClass("active");
					$("#manUsers1>div").removeClass("active");
					$('a[href="#UsersAutonym"]').parent().addClass("active");
					$("#UsersAutonym").addClass("active");
				})
				$('a[href="#getNews"]').click(function(){
					$("#manUsers>li").removeClass("active");
					$("#manUsers1>div").removeClass("active");
					$('a[href="#getNews"]').parent().addClass("active");
					$("#getNews").addClass("active");
				})
				$('a[href="#addNews"]').click(function(){
					$("#manUsers>li").removeClass("active");
					$("#manUsers1>div").removeClass("active");
					$('a[href="#addNews"]').parent().addClass("active");
					$("#addNews").addClass("active");
				})
			})
			
		
						$(document).ready(function() {
							ajaxPage(1)
							ajaxPage1(1)
							ajaxPage2(1)
							ajaxPage3(1)
						});
			
						function ajaxPage(page) {
							$.ajax({
								url: "getAllUsers",
								dataType: "JSON",
								type: "get",
								data: {
									pageNum: page
								},
								success: function(result) {
									//console.log(result);
									var pageInfo = result.extend["pageInfo"]
									var msg = ""
									var msg1=""
									$.each(pageInfo.list, function(i, item) {
										
										msg += "<tr>" +
											"<td>" + (parseInt(pageInfo.pageNum - 1) * 5 + 1 + i) + "</td>" +
											"<td>" + item.usEmail + "</td>" +
											"<td>" + item.usName + "</td>" +
											"<td>" + item.usIdcard + "</td>" +
											"<td>" + item.usPhone + "</td>" +
											"<td>" + item.usAddress + "</td>" +
											"<td>" + item.usSex + "</td>" +
											
											"</tr>"
											
										
									})
									$("#userslist").html(msg)
									build_page_nav(pageInfo);
								},
								error: function(err) {}
							})
						}
			
						function ajaxPage1(page) {
							$.ajax({
								url: "getAllUsers",
								dataType: "JSON",
								type: "get",
								data: {
									pageNum: page
								},
								success: function(result) {
									//console.log(result);
									var pageInfo = result.extend["pageInfo"]
									
									var msg1=""
									$.each(pageInfo.list, function(i, item) {
										
										msg1 +="<tr>" +
											"<td>" + (parseInt(pageInfo.pageNum - 1) * 5 + 1 + i) + "</td>" +
											"<td>" + item.usName + "</td>" +
											"<td>" + item.usMoney + "</td>" +
											"<td>"+
											"<span onclick='usersDetail("+item.usId+")' class='btn btn-info usersDetail' data-toggle='modal' data-target='#usersDetail'>详情</span>"+
											"</td>"+
											"</tr>"
									})
									
									$("#usersAccount").html(msg1)
									build_page_nav1(pageInfo);
								},
								error: function(err) {}
							})
						}
			
						function ajaxPage2(page) {
							$.ajax({
								url: "getUsersByUsRole",
								dataType: "JSON",
								type: "get",
								data: {
									pn: page
								},
								success: function(result) {
									var pageInfo = result.extend["pageInfo"]
									var msg2=""
									$.each(pageInfo.list, function(i, item) {
										msg2 +="<tr>" +
											"<td>" + (parseInt(pageInfo.pageNum - 1) * 5 + 1 + i) + "</td>" +
											"<td>" + item.usName + "</td>" +
											"<td>" + item.usIdcard + "</td>" +
											"<td>" + item.usPhone + "</td>" +
											"<td>"+
											"<span onclick='updateRole("+item.usId+")' class='btn btn-info updateRole'>审核通过</span>"+
											"<span onclick='updateRole1("+item.usId+")' class='btn btn-info updateRole1'>审核不通过</span>"+
											"</td>"+
											"</tr>"
									})
									
									$("#updateUserRole").html(msg2)
									build_page_nav2(pageInfo);
								},
								error: function(err) {}
							})
						}
						
						function ajaxPage3(page) {
							$.ajax({
								url: "getAllQuestionOther",
								dataType: "JSON",
								type: "get",
								data: {
									pn: page
								},
								success: function(result) {
									var pageInfo = result.extend["pageInfo"]
									var msg3=""
									$.each(pageInfo.list, function(i, item) {
										msg3 +="<tr>" +
											"<td>" + (parseInt(pageInfo.pageNum - 1) * 5 + 1 + i) + "</td>" +
											"<td>" + item.questionothername + "</td>" +
											"<td>" + item.questionanswer + "</td>" +
											"<td>" + item.questiondate + "</td>" +
											"<td>"+
											"<span onclick='getNewsById("+item.questionotherid+")' class='btn btn-info getNewsById'>修改</span>"+
											"<span onclick='deleteNews("+item.questionotherid+")' class='btn btn-info deleteNews'>删除</span>"+
											"</td>"+
											"</tr>"
									})
									
									$("#news").html(msg3)
									build_page_nav3(pageInfo);
								},
								error: function(err) {}
							})
						}
			
						function emps(pageNum){
							event.stopPropagation();
							console.log(pageNum)
							ajaxPage(pageNum)
							
						}
						
						function emps1(pageNum){
							event.stopPropagation();
							console.log(pageNum)
							ajaxPage1(pageNum)
							
						}
			
						function emps2(pageNum){
							event.stopPropagation();
							console.log(pageNum)
							ajaxPage2(pageNum)
							
						}
						
						function emps3(pageNum){
							event.stopPropagation();
							console.log(pageNum)
							ajaxPage3(pageNum)
							
						}
			
						function build_page_nav(pageInfo2) {
							//上一页
							var previous2 = ""
							if (pageInfo2.hasPreviousPage) {
								previous2 = previous2 + "<li><span onclick='emps(" +
									(parseInt(pageInfo2.pageNum) - parseInt(1)) + ")' aria-label='Previous'>" +
									"<span aria-hidden='true'>&laquo;</span>" +
									"</span></li>"
							}
							//下一页
							var next2 = ""
							if (pageInfo2.hasNextPage) {
								next2 = next2 + "<li><span onclick='emps(" +
									(parseInt(pageInfo2.pageNum) + parseInt(1)) +
									")' aria-label='Next'>" +
									"<span aria-hidden='true'>&raquo;</span>" +
									"</span></li>"
							}
							//页数
							var pageNum2 = ""
							$.each(pageInfo2.navigatepageNums, function(i, item) {
			
								if (item == pageInfo2.pageNum) {
									pageNum2 += "<li class='active'><span>" + item + "</span></li>"
								} else {
									pageNum2 += "<li><span class='emps' onclick='emps(" + item +
										")'>" + item + "</span></li>"
								}
			
			
							})
							
							var msg = ""
							msg += "<li><span onclick='emps(" +
								pageInfo2.navigateFirstPage + ")'>首页</span></li>" +
								previous2 + pageNum2 + next2 + "<li><span onclick='emps(" +
								pageInfo2.navigateLastPage + ")'>末页</span></li>"
								
							
							$("#showPage").html(msg);
			
						}
				
					function build_page_nav1(pageInfo2) {
						//上一页
						var previous2 = ""
						if (pageInfo2.hasPreviousPage) {
							previous2 = previous2 + "<li><span onclick='emps1(" +
								(parseInt(pageInfo2.pageNum) - parseInt(1)) + ")' aria-label='Previous'>" +
								"<span aria-hidden='true'>&laquo;</span>" +
								"</span></li>"
						}
						//下一页
						var next2 = ""
						if (pageInfo2.hasNextPage) {
							next2 = next2 + "<li><span onclick='emps1(" +
								(parseInt(pageInfo2.pageNum) + parseInt(1)) +
								")' aria-label='Next'>" +
								"<span aria-hidden='true'>&raquo;</span>" +
								"</span></li>"
						}
						//页数
						var pageNum2 = ""
						$.each(pageInfo2.navigatepageNums, function(i, item) {
								
							if (item == pageInfo2.pageNum) {
								pageNum2 += "<li class='active'><span>" + item + "</span></li>"
							} else {
								pageNum2 += "<li><span class='emps' onclick='emps1(" + item +
									")'>" + item + "</span></li>"
							}
								
								
						})
						
						var msg1 = ""
						msg1 += "<li><span onclick='emps1(" +
							pageInfo2.navigateFirstPage + ")'>首页</span></li>" +
							previous2 + pageNum2 + next2 + "<li><span onclick='emps1(" +
							pageInfo2.navigateLastPage + ")'>末页</span></li>"
	
						$("#showPage1").html(msg1);
					}
					
			function build_page_nav2(pageInfo2) {
				//上一页
				var previous2 = ""
				if (pageInfo2.hasPreviousPage) {
					previous2 = previous2 + "<li><span onclick='emps2(" +
						(parseInt(pageInfo2.pageNum) - parseInt(1)) + ")' aria-label='Previous'>" +
						"<span aria-hidden='true'>&laquo;</span>" +
						"</span></li>"
				}
				//下一页
				var next2 = ""
				if (pageInfo2.hasNextPage) {
					next2 = next2 + "<li><span onclick='emps2(" +
						(parseInt(pageInfo2.pageNum) + parseInt(1)) +
						")' aria-label='Next'>" +
						"<span aria-hidden='true'>&raquo;</span>" +
						"</span></li>"
				}
				//页数
				var pageNum2 = ""
				$.each(pageInfo2.navigatepageNums, function(i, item) {
						
					if (item == pageInfo2.pageNum) {
						pageNum2 += "<li class='active'><span>" + item + "</span></li>"
					} else {
						pageNum2 += "<li><span class='emps' onclick='emps2(" + item +
							")'>" + item + "</span></li>"
					}
						
						
				})
				
				var msg2 = ""
				msg2 += "<li><span onclick='emps2(" +
					pageInfo2.navigateFirstPage + ")'>首页</span></li>" +
					previous2 + pageNum2 + next2 + "<li><span onclick='emps2(" +
					pageInfo2.navigateLastPage + ")'>末页</span></li>"
					
				
				$("#showPage2").html(msg2);
						
			}
			
			function build_page_nav3(pageInfo2) {
				//上一页
				var previous2 = ""
				if (pageInfo2.hasPreviousPage) {
					previous2 = previous2 + "<li><span onclick='emps3(" +
						(parseInt(pageInfo2.pageNum) - parseInt(1)) + ")' aria-label='Previous'>" +
						"<span aria-hidden='true'>&laquo;</span>" +
						"</span></li>"
				}
				//下一页
				var next2 = ""
				if (pageInfo2.hasNextPage) {
					next2 = next2 + "<li><span onclick='emps3(" +
						(parseInt(pageInfo2.pageNum) + parseInt(1)) +
						")' aria-label='Next'>" +
						"<span aria-hidden='true'>&raquo;</span>" +
						"</span></li>"
				}
				//页数
				var pageNum2 = ""
				$.each(pageInfo2.navigatepageNums, function(i, item) {
						
					if (item == pageInfo2.pageNum) {
						pageNum2 += "<li class='active'><span>" + item + "</span></li>"
					} else {
						pageNum2 += "<li><span class='emps' onclick='emps3(" + item +
							")'>" + item + "</span></li>"
					}
						
						
				})
				
				var msg3 = ""
				msg3 += "<li><span onclick='emps3(" +
					pageInfo2.navigateFirstPage + ")'>首页</span></li>" +
					previous2 + pageNum2 + next2 + "<li><span onclick='emps3(" +
					pageInfo2.navigateLastPage + ")'>末页</span></li>"
					
				
				$("#showPage3").html(msg3);
						
			}
			
			function usersDetail(usId){
				
				$.ajax({
					url:"getUsersMoneyById",
					dataType:"JSON",
					data:{usId:usId},
					success:function(data){
						//alert(data.extend["usMoney"])
						//alert(data.extend["totalMoney"])
						
						$("#fdUsId").val(usId)
						
						
						$("#usMoney").val(data.extend["usMoney"])
						$("#totalMoney").val(data.extend["totalMoney"])

					}
				})
			}
			
			function getNewsById(questionotherid){
				
				$.ajax({
					url:"getNewsById",
					dataType:"JSON",
					data:{questionotherid:questionotherid},
					success:function(data){
						
						$("#questionotherid").val(questionotherid)
						$("#questionothername").val(data.extend["question"].questionothername)
						$("#questionanswer").val(data.extend["question"].questionanswer)
			
					}
				})
			}
			
		$(document).on("click",".usersDetail",function(){
		  	   //清空信息
				//usersDetail(usId);
		  	   
		  	   //弹出模态框
		  	   $("#usersDetailModal").modal({
		  		   backdrop:"static"
		  	   });
		     });
		     
		$(document).on("click",".getNewsById",function(){
			   	   //弹出模态框
			   	  $("#updateNewsModal").modal({
			   		   backdrop:"static"
			   	  });
		});
			 
		function updateRole(usId){
			
				if(confirm("确定审核通过吗？")){
					$.ajax({
						url:"updateUserRole",
						dataType:"JSON",
						type:"post",
						data:{usId:usId},
						success:function(data){
							alert("审核通过成功")
							ajaxPage2(1);
						},
						error:function(err){
							alert("审核通过失败")
							ajaxPage2(1);
						}
					})
				}
			
		}
			
		function updateRole1(usId){
			if(confirm("确定审核不通过吗？")){
				alert("审核通过失败")
				ajaxPage2(1);
			}
			
		}

			$("#updateOneNews").click(function(){
				$.ajax({
					url:"updateQuestionOther", 
					dataType:"JSON",
					data:{
						"questionotherid":$("#questionotherid").val(),
						"questionothername":$("#questionothername").val(),
						"questionanswer":$("#questionanswer").val(),
					},
					success:function(data){
						alert("修改成功")
						$('#updateNewsModal').modal('hide')
						ajaxPage3(1);
					}
				})
			})
			
			function deleteNews(questionotherid){
				
					if(confirm("确定删除此新闻吗？")){
						$.ajax({
							url:"deleteQuestionOther",
							dataType:"JSON",
							type:"post",
							data:{questionotherid:questionotherid},
							success:function(data){
								alert("删除成功")
								ajaxPage3(1);
							},
							error:function(err){
								alert("删除失败")
								ajaxPage3(1);
							}
						})
					}
				
			}
			
			$("#addOneNews").click(function(){
				$.ajax({
					url:"addQuestionOther",
					dataType:"JSON",
					type:"post",
					data:{
						"questionothername":$("#questionothername1").val(),
						"questionanswer":$("#questionanswer1").val(),
					},
					success:function(data){
						alert("添加成功")
					},
					error:function(err){
						alert("添加失败")
					}
				})	
			})
		</script>
	</body>
</html>
